<?php
$con = mysqli_connect('localhost', 'root', 'vertrigo', 'test');
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$name = mysqli_real_escape_string($con, $_POST['name']);

$sql="INSERT INTO Persons (name)
VALUES ('$name')";

if (!mysqli_query($con,$sql)) {
  die('Error: ' . mysqli_error($con));
}
echo "1 record added";

mysqli_close($con);
?>

